<template>
<div>
		<div class="common-form">
			<span>{{curItem.name}}</span>
		</div>
		<el-form size="small" :model="curItem" label-width="100px">
			<!--组件样式-->
			<div class="form-chink"></div>
			<div class="f16 gray3 form-subtitle">{{$t('page.component_style')}}</div>
			<!--上下边距-->
			<div class="form-item">
				<div class="form-label">{{$t('page.margin_top_label')}}</div>
				<el-slider v-model="curItem.style.paddingTop" size="small" show-input :show-input-controls="false" input-size="small"></el-slider>
			</div>
			<!--上下边距-->
			<div class="form-item">
				<div class="form-label">{{$t('page.margin_bottom_label')}}</div>
				<el-slider v-model="curItem.style.paddingBottom" size="small" show-input :show-input-controls="false" input-size="small"></el-slider>
			</div>
			<!--左右边距-->
			<div class="form-item">
				<div class="form-label">{{$t('page.margin_lr_label')}}</div>
				<el-slider v-model="curItem.style.paddingLeft" size="small" show-input :show-input-controls="false" input-size="small"></el-slider>
			</div>
			<!--上圆角-->
			<div class="form-item">
				<div class="form-label">{{$t('page.border_radius_top_label')}}</div>
				<el-slider v-model="curItem.style.topRadio" size="small" show-input :show-input-controls="false" input-size="small"></el-slider>
			</div>
			<!--下圆角-->
			<div class="form-item">
				<div class="form-label">{{$t('page.border_radius_bottom_label')}}</div>
				<el-slider v-model="curItem.style.bottomRadio" size="small" show-input :show-input-controls="false" input-size="small"></el-slider>
			</div>
			<div class="form-item">
				<div class="form-label">{{$t('page.footer_bg_label')}}</div>
				<div class="flex-1 d-s-c" style="height: 36px;">
					<el-color-picker size="default" v-model="curItem.style.bgcolor"></el-color-picker>
					<el-input class="ml10" v-model="curItem.style.bgcolor" :placeholder="$t('page.transparent')" />
					<el-button style="margin-left: 10px;" @click.stop="$parent.onEditorResetColor(curItem.style, 'bgcolor', '#f2f2f2')" type="primary" link>{{$t('page.reset')}}</el-button>
				</div>
			</div>
			<!--视频高度-->
			<el-form-item :label="$t('page.video_height')">
				<el-slider max="800" v-model="curItem.style.height" size="small" show-input :show-input-controls="false" input-size="small"></el-slider>
				<div>{{$t('page.slider_keyboard_tip')}}</div>
			</el-form-item>
			<div class="form-chink"></div>
			<div class="f16 gray3 form-subtitle">{{$t('page.video_setting')}}</div>
			<!--视频封面-->
			<el-form-item :label="$t('page.video_cover')">
				<div class="diy-video-cover"><img v-img-url="curItem.params.poster" alt="" @click="$parent.onEditorSelectImage(curItem.params, 'poster')" /></div>
			</el-form-item>
			<!--视频地址-->
			<el-form-item :label="$t('page.video_url')"><el-input v-model="curItem.params.videoUrl"></el-input></el-form-item>
			<!--自动播放-->
			<el-form-item :label="$t('page.autoplay')">
				<el-radio-group v-model="curItem.params.autoplay">
					<el-radio :label="0">{{$t('page.no')}}</el-radio>
					<el-radio :label="1">{{$t('page.yes')}}</el-radio>
				</el-radio-group>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
export default {
  data() {
    return {
      paddingTop: 0,
      height: 0
    };
  },
  props: ['curItem', 'selectedIndex'],
  created() {
    this.curItem.style.paddingTop = parseInt(this.curItem.style.paddingTop);
    this.curItem.style.height = parseInt(this.curItem.style.height);
  },
  watch: {},
  methods: {}
};
</script>

<style lang="scss" scoped>
.diy-video-cover {
	width: 200px;
}
.diy-video-cover img {
	width: 100%;
}
</style>

